﻿@model Stardust.Models.ProductoXAlmacenBean

@{
    ViewBag.Title = "Asignar Productos";
}

<h2>Asignar Productos</h2>
<p></p><p></p><p></p>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
  
  @using (Html.BeginForm("guardarproductosxAlmacen", "Producto", FormMethod.Post, new { @class = "form" }))
  {
    @Html.HiddenFor(model => model.idalmacen) 
      @Html.HiddenFor(model => model.idhotel) 
    <fieldset>
        <div class="widget">
            <div class="title">
                <h6>Hotel</h6>
            </div>
            <div class="formRow"> @Html.LabelFor(model => model.Hotel)
                <div class=" formRight"> @Html.TextBoxFor(model => model.Hotel, new { @readonly = "readonly" })  </div>
                <div class="clear"></div>
            </div>
        </div>
    </fieldset>
    
    <p></p><p></p><p></p><p></p>
      
   <div class="wrapper">
    <div class="widget">
      <div class="title">
      <h6>Lista de Productos</h6>
      </div>
      <div class="">

        <table cellpadding = "0" cellspacing = "0" border="0" width = "100%" class = "">
        <thead>
        <tr>
            <th class="ui-state-default" rowspan="1" colspan="1" style="width:160px;">
                <div class="DataTables_sort_wrapper">
                Producto
                <span class="DataTables_sort_icon css_right ui-icon ui-icon-triangle-1-s"></span>
                </div>
             </th>
            <th class="ui-state-default" rowspan="1" colspan="1" style="width:160px;">
                <div class="DataTables_sort_wrapper">
                Stock Minimo
                <span class="DataTables_sort_icon css_right ui-icon ui-icon-triangle-1-s"></span>
                </div>
             </th>
             <th class="ui-state-default" rowspan="1" colspan="1" style="width:120px;" >
                <div class="DataTables_sort_wrapper">
                Stock Actual
                <span class="DataTables_sort_icon css_right ui-icon ui-icon-triangle-1-s"></span>
                </div>
             </th>
             <th class="ui-state-default" rowspan="1" colspan="1" style="width:120px;" >
                <div class="DataTables_sort_wrapper">
                Stock Máximo
                <span class="DataTables_sort_icon css_right ui-icon ui-icon-triangle-1-s"></span>
                </div>
             </th>
        </tr>
    </thead>

        <tbody>
    @for (int i = 0; i < Model.listProdalmacen.Count; i++)
    {

        if (!Model.listProdalmacen[i].estado2)
        {
         @Html.HiddenFor(model => model.listProdalmacen[i].ID) 
         
     <tr class="gradeA odd">       
                
                <td> @Html.TextBoxFor(model => model.listProdalmacen[i].nombre, new { @readonly = "readonly" }) </td>
                <td> @Html.TextBoxFor(model => model.listProdalmacen[i].stockminimo)  @Html.ValidationMessageFor(model => model.listProdalmacen[i].stockminimo)      </td>
                <td> @Html.TextBoxFor(model => model.listProdalmacen[i].stockactual)  @Html.ValidationMessageFor(model => model.listProdalmacen[i].stockactual)       </td>
                <td> @Html.TextBoxFor(model => model.listProdalmacen[i].stockmaximo)  @Html.ValidationMessageFor(model => model.listProdalmacen[i].stockmaximo)     </td>   
     </tr>
        }
        else
        {
            @Html.HiddenFor(model => model.listProdalmacen[i].nombre) 
            @Html.HiddenFor(model => model.listProdalmacen[i].stockminimo)         
            @Html.HiddenFor(model => model.listProdalmacen[i].stockactual)  
            @Html.HiddenFor(model => model.listProdalmacen[i].stockmaximo)
        }
    }

    
    </tbody>
        </table>


      </div>
        
    </div>
    </div>
      
@*<table cellpadding = "0" cellspacing = "0" width = "100%" class = "sTable" >

    <thead>
        <tr>
           
            <td>Producto</td>
            <td>Stock Mínimo</td>
            <td>Stock Actual</td>
            <td>Stock Máximo</td>
        
        </tr>
    </thead>

    <tbody>
    @for (int i = 0; i < Model.listProdalmacen.Count; i++)
    {

        if (!Model.listProdalmacen[i].estado2)
        {
         @Html.HiddenFor(model => model.listProdalmacen[i].ID) 
         
     <tr>       
                
                <td> @Html.TextBoxFor(model => model.listProdalmacen[i].nombre, new { @readonly = "readonly" }) </td>
                <td> @Html.TextBoxFor(model => model.listProdalmacen[i].stockminimo, new { @class = "validate[custom[onlyNumberSp]]", name = "numsValid", placeholder = "0" })         </td>
                <td> @Html.TextBoxFor(model => model.listProdalmacen[i].stockactual, new { @class = "validate[custom[onlyNumberSp]]", name = "numsValid", placeholder = "0" })         </td>
                <td> @Html.TextBoxFor(model => model.listProdalmacen[i].stockmaximo, new { @class = "validate[custom[onlyNumberSp]]", name = "numsValid", placeholder = "0" })         </td>   
     </tr>
        }
        else
        {
            @Html.HiddenFor(model => model.listProdalmacen[i].nombre) 
            @Html.HiddenFor(model => model.listProdalmacen[i].stockminimo)         
            @Html.HiddenFor(model => model.listProdalmacen[i].stockactual)  
            @Html.HiddenFor(model => model.listProdalmacen[i].stockmaximo)
        }
    }

    
    </tbody>

    </table>*@
    <p>
        <input type="submit" value="Aceptar" class = "redB" />
    </p>
      @Html.ActionLink("Regresar", "ListarProductosdeAlmacen/" + Model.idhotel, "Producto")
  }

    
          

